<!DOCTYPE html>
<html dir="ltr" lang="{{ lang }}">
<head>
<base href="{{ CurrentUrl }}">
{% include 'meta.twig' %}
<link href="{{ path_fix }}resource/css/styles.css" media="screen, print" rel="stylesheet" type="text/css">
<link href="{{ path_fix }}vendor/twitter/bootstrap/dist/css/bootstrap.min.css" media="screen, print" rel="stylesheet" type="text/css">
<link href="{{ path_fix }}resource/css/bootstrap-multiselect.css" media="screen, print" rel="stylesheet" type="text/css">
<link href="{{ path_fix }}resource/css/jquery.mCustomScrollbar.css" rel="stylesheet" type="text/css" />
{% if ServiceCustomCss %}
<link href="{{ path_fix }}{{ ServiceCustomCss }}" media="screen, print" rel="stylesheet" type="text/css">
{% endif %}


{% include 'footer.inc' ignore missing %}
<title>{{ ServiceName }}{% block title %}{% endblock %}</title>
</head>
<body>
  <div class="topbar{% if vocab_id != '' or vocab_id == 'feedback' or vocab_id == 'about' %} topbar-white{% endif %}">
    {% include 'topbar.twig' %}
  </div>
  {% block headernav %}
  <div class="headerbar{% if vocab_id == '' %} frontpage-spacing{% endif %}{% if vocab_id != '' or vocab_id == 'feedback' or vocab_id == 'about' %} headerbar-coloured{% endif %}">
    {% include 'headerbar.twig' %}
  </div>
  {% endblock %}
  <section>
    {% if not vocab_id == '' %}
    <div id="sidebar">
    {% block sidebar %}
      {% if vocab_id != '' or vocab_id == 'feedback' or vocab_id == 'about' %}
      <div class="sidebar-buttons">
        <ul class="nav nav-tabs">
          <li id="alpha"{% if search_results|length != 1 %} class ="active"{% endif %}><a href="{{ path_fix }}{{ vocab_id }}/{{ lang }}/index">{% trans "Alpha-nav" %}</a></li>
          {% if search_results|length == 1 or vocab.showHierarchy %}
          <li id="hierarchy"{% if search_results|length == 1 %} class ="active"{% endif %}><a href="#" id="hier-trigger">{% trans "Hier-nav" %}</a></li>
          {% endif %}
          {% if vocab.groupClassURI %}
          <li id="groups"><a href="{{ path_fix }}{{ vocab_id }}/{{ lang }}/groups">{% trans "Group-nav" %}</a></li>
          {% else %}
          {% endif %}
        </ul>
      </div>
      <div class="sidebar-grey">
        {% set letters = 'A'..'Z' %} {# it would be nicer to do this according to the actual appearances of letters i.e. only letters with results should be shown #}
        {% set rest = ['Å', 'Ä', 'Ö', '!*'] %}
        <ul class="pagination">
        {% for letter in [['0-9'], letters, rest] %} {# looping through all letters #}
          {%  for letter2 in letter %}
            <li{% if search_letter == letter2 %} class="active"{% endif %}><a href="{{ path_fix }}{{ vocab_id }}/{{ lang }}/index/{{ letter2 }}">{{ letter2 }}</a></li>
          {% endfor %}
        {% endfor %}
        </ul>
        <hr />
        <div id="alphabetical-menu">
          {% if search_results %}
            {% set previous = '' %}
            <ul class="list-group alphabetical-search-results side-navi">
              {% for key,value in search_results %}
              {% if all_letters == true %}
                {% set alpha = value.prefLabel|first %}{% if alpha != previous %}<li class="alphabet-header" name="{{ alpha }}"><h5>{{ alpha }}</h5></li>{% set previous = alpha %}{% endif %}
              {% endif %}
              <li>
              {% if value.altLabel %}
              {{ value.altLabel }} 	&rarr; <a href="{{ value.uri | link_url(vocab,lang) }}">{{ value.prefLabel }}</a>
              {% else %}
              <a href="{{ value.uri | link_url(vocab,lang) }}">{{ value.prefLabel }}</a>
              {% endif %}
             </li>
              {% endfor %}
            </ul>
            {% else %}<span class="header-text-small-font">{% trans %}Error: the vocabulary does not contain terms beginning with "{{ letter }}"!{% endtrans %}</span>
          {% endif %}
        </div>
      </div>
      {% endif %}
    {% endblock %}
  {% endif %}

    </div>
    {% if vocab_id == '' and vocab_id != 'feedback' and vocab_id != 'about' and not global_search %}
      {% include 'left.inc' ignore missing %}
      {% include 'vocabularylist.twig' %}
    {% endif %}
    <div class="content">
    {% block content %}
    {% endblock %}
    </div>
    {% if vocab_id == '' and not global_search %}
      {% include 'right.inc' ignore missing %}
    {% endif %}
    <footer id="footer"></footer>
  </section>
  {% include 'scripts.twig' %}
</body>
</html>
